package com.example.boot05.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class BMIController {
    @RequestMapping("/bmi")
    public String bmi(double h, double w) {
        double bmi = w / (h * h);
        if (bmi < 18.4) {
            return "偏瘦";
        }
        if (bmi < 23.9) {
            return "正常";
        }
        if (bmi < 27.9) {
            return "微胖";
        }
        return "贼胖";
    }
}
